package com.menu.system.service.impl;

import com.menu.common.utils.DateUtils;
import com.menu.system.domain.ReceptionMenu;
import com.menu.system.mapper.receptionMenuMapper;
import com.menu.system.service.IreceptionMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 前台菜单权限Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-06
 */
@Service
public class receptionMenuServiceImpl implements IreceptionMenuService {
    @Autowired
    private receptionMenuMapper receptionMenuMapper;

    /**
     * 查询前台菜单权限
     *
     * @param menuId 前台菜单权限主键
     * @return 前台菜单权限
     */
    @Override
    public ReceptionMenu selectreceptionMenuByMenuId(Long menuId) {
        return receptionMenuMapper.selectreceptionMenuByMenuId(menuId);
    }

    /**
     * 查询前台菜单权限列表
     *
     * @param receptionMenu 前台菜单权限
     * @return 前台菜单权限
     */
    @Override
    public List<ReceptionMenu> selectreceptionMenuList(ReceptionMenu receptionMenu) {
        return receptionMenuMapper.selectreceptionMenuList(receptionMenu);
    }

    /**
     * 新增前台菜单权限
     *
     * @param receptionMenu 前台菜单权限
     * @return 结果
     */
    @Override
    public int insertreceptionMenu(ReceptionMenu receptionMenu) {
        receptionMenu.setCreateTime(DateUtils.getNowDate());
        return receptionMenuMapper.insertreceptionMenu(receptionMenu);
    }

    /**
     * 修改前台菜单权限
     *
     * @param receptionMenu 前台菜单权限
     * @return 结果
     */
    @Override
    public int updatereceptionMenu(ReceptionMenu receptionMenu) {
        receptionMenu.setUpdateTime(DateUtils.getNowDate());
        return receptionMenuMapper.updatereceptionMenu(receptionMenu);
    }

    /**
     * 批量删除前台菜单权限
     *
     * @param menuIds 需要删除的前台菜单权限主键
     * @return 结果
     */
    @Override
    public int deletereceptionMenuByMenuIds(Long[] menuIds) {
        return receptionMenuMapper.deletereceptionMenuByMenuIds(menuIds);
    }

    /**
     * 删除前台菜单权限信息
     *
     * @param menuId 前台菜单权限主键
     * @return 结果
     */
    @Override
    public int deletereceptionMenuByMenuId(Long menuId) {
        return receptionMenuMapper.deletereceptionMenuByMenuId(menuId);
    }
}
